<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/29 0029
 * Time: 上午 9:12
 */

namespace app\admin\Validate;


use think\Validate;

class Admin extends Validate
{


    protected $rule = [
        'admin_password'  => 'require',
        'admin_name'   => 'require|unique:admin',
    ];

    protected $message = [
        'admin_name.require' => '用户名不能为空',
        'admin_name.unique' => '用户名已存在',
        'admin_password.require'     => '密码不能为空',
    ];

    //场景不同场景验证不同的字段
    protected $scene = [
        'add_admin'    => ['admin_name','admin_password'],
        'edit_admin' => [''],
    ];



}
